package myJs.user.mission.diffAnaResult

import myJs.myPkg.jquery._
import myJs.tool.Tool
import myJs.user.mission.{MissionResult, boxplotResult}
import org.scalajs.dom.document

import scala.scalajs.js.Dynamic.{global => g}
import scala.scalajs.js.annotation.{JSExport, JSExportTopLevel}
import myJs.projectCps._
import myJs.projectCps.boxplot.Cp

/**
 * Created by yz on 2019/4/25
 */
@JSExportTopLevel("DiffAnaResult")
object DiffAnaResult extends MissionResult {


  @JSExport("init")
  def init = {
    refreshMissionInfo(getMissionId)
    refreshFileInfo(getMissionId)
    registerEvent

    diffAnaTab.Cp.Props().render.renderIntoDOM(document.querySelector("#root"))

    selfInit

  }

  def selfInit = {
    Tool.initMiniColors
  }

  def myToggle(tabId: String) = {
    $(s"#${tabId} #content").toggleClass("col-sm-12 col-sm-8")
    $(s"#${tabId} #sidebar").toggleClass("collapsed")
    $(s"#${tabId} .myToggle i").toggleClass("fa-angle-double-right fa-angle-double-left")
  }

  def getMissionId = {
    g.missionId.toString
  }

}
